from django.db import models


class Book(models.Model):
    name = models.CharField(max_length=64, null=False, blank=False)
    cover = models.URLField()
    description = models.CharField(max_length=512)
    price = models.FloatField(default=0.0)
    content = models.TextField(null=True,blank=True)
    author = models.ForeignKey(
        'user.User', on_delete=models.CASCADE, related_name='published')

    class Meta:
        db_table = 'books'
